Skip to content

test(specimens): add reviewable viewport receipts - #2

Open
BunsDev wants to merge 76 commits into
mainfrom
test/specimen-visual-review
Open

test(specimens): add reviewable viewport receipts#2
BunsDev wants to merge 76 commits into
mainfrom
test/specimen-visual-review

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 27, 2026

Copy link
Copy Markdown
Member

Objective

Make specimen-browser visual changes reviewable through durable viewport receipts rather than an unrecorded manual spot-check.

This PR is stacked on #1 and should merge after it.

What changed

  • adds a dependency-free Chrome DevTools Protocol renderer for the specimen app
  • captures deliberate Library / Assembled receipts across dark and light schemes, cozy and compact density, desktop and mobile viewports
  • adds a mobile-quality matrix for 320, 375, 390, and 430px widths
  • explicitly verifies RTL, reduced motion, 44px interaction targets, and 390px at 200% root-text scaling
  • asserts visible shell landmarks, zero document/card/stage/tab overflow, persisted scheme and density, all 16 specimens, all three catalog groups, and all five assembled tabs
  • verifies SessionHeader and TranscriptTurn remain contained and that mobile session titles are not ellipsized
  • distinguishes intentional assembled-tab scrolling from hidden clipping
  • hardens Chrome teardown so successful runs cannot fail while the temporary profile is still being released
  • uploads PNG receipts, machine-readable summaries, Markdown summaries, the Vite preview log, and Chrome diagnostics on failure
  • documents exactly what a green result proves and what remains a human visual judgment
  • pins workflow actions to immutable revisions

Deliberate non-goals

  • no pixel-perfect golden-image baseline
  • no Playwright, Puppeteer, or other package dependency
  • no exported UI behavior or token changes
  • no replacement for product-level visual testing in Cave

Verification

Final head: a250e451b8181e2b1b623f9bc48eed8f0e1b0ca3

  • GitHub CIsuccess
  • GitHub Visual reviewsuccess
  • no inline review threads
  • mergeability — clean
  • visual receipts inspected

Passing browser scenarios:

  • Library · dark · desktop
  • Library · dark · mobile
  • Library · light · compact desktop
  • Assembled · dark · desktop
  • Assembled · dark · mobile

Passing mobile-quality scenarios:

  • 320px · dark · cozy
  • 375px · light · compact
  • 390px · dark · cozy
  • 430px · light · cozy
  • 390px · dark · RTL
  • 390px · dark · 200% text

The 200% text scenario reports zero document, card, stage, tab-root, transcript, and session-header overflow; tab targets remain at least 44px, reduced motion is active, and the session title remains visible without ellipsis.

Final file set

  • .github/workflows/visual-review.yml
  • apps/specimens/src/specimens-fixes.css
  • handoffs/visual-review.md
  • scripts/mobile-quality-review.mjs
  • scripts/verify-contracts.mjs
  • scripts/visual-review.mjs

Risk and rollback

The workflow is additive and dependency-free. It exercises the built specimen app without changing package runtime behavior. Revert this PR to remove the hosted receipt lane and its focused mobile-quality guards.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opencoven-ui Ready Ready Preview Aug 31, 2026 4:56am
ui Error Error Aug 31, 2026 4:56am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a dependency-free, Chrome DevTools Protocol–driven visual review lane for the specimens app so viewport receipts (PNGs + summaries) can be captured and reviewed durably in CI, instead of relying on manual spot-checks.

Changes:

  • Introduces a CDP-based renderer (scripts/visual-review.mjs) that captures scenario screenshots and validates key layout/runtime invariants.
  • Adds a stricter mobile-quality matrix runner (scripts/mobile-quality-review.mjs) to validate overflow, tab target sizing, RTL, reduced motion, and 200% root text scaling.
  • Adds a dedicated GitHub Actions workflow to run and upload the visual/mobile-quality artifacts, plus documentation and additional responsive guards/contracts.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/visual-review.yml Adds CI job to build/preview specimens, run both review scripts, and upload artifacts.
apps/specimens/src/specimens-fixes.css Adds additional mobile overflow/containment CSS guards to support reliable viewport receipts.
handoffs/visual-review.md Documents what the workflow validates, how to run it locally, and review expectations.
scripts/mobile-quality-review.mjs New mobile matrix runner validating overflow, targets, RTL, reduced motion, and text scaling; captures PNGs and summaries.
scripts/verify-contracts.mjs Extends contract verification to assert minmax(0, 1fr) responsive grid flooring guards are present.
scripts/visual-review.mjs New CDP-based screenshot + invariant checker for library and assembled scenarios; emits receipts and summaries.
Suppressed comments (1)

scripts/mobile-quality-review.mjs:375

  • The PR description/handoff mentions Chrome diagnostics on failure, but this script never writes a Chrome log when an error occurs. Since stdout/stderr are already being collected (see earlier comment), add a catch block to persist chrome.log before rethrowing so failures are diagnosable from artifacts.
} finally {

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +58 to +69

const chrome = spawn(chromePath, [
"--headless=new",
"--no-sandbox",
"--disable-dev-shm-usage",
"--disable-gpu",
"--hide-scrollbars",
`--remote-debugging-port=${port}`,
`--user-data-dir=${profile}`,
"about:blank",
]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants